
import mockRequest from '@/utils/mockRequest.js'

const state = {
  data: {}
}

const mutations = {
  GETDATA(state, data){
    state.data = data
  }
}

const actions = {
  // 发请求 获取首页的mock数据
  async getData({commit}){
    let result = await mockRequest.get('/home/list')
    if(result.code==20000){
      commit('GETDATA', result.data)

    }
  }
}


export default {
  namespaced: true,
  state,
  mutations,
  actions
}
